package com.zc.angelica.utils;

import com.zc.angelica.entity.Account;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;

public class SecurityUtil {

    public static Account getAccountInfo(){
        Account account = null;
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        try {
            account = (Account) authentication.getPrincipal();
        }catch (Exception e){
        }
        return account;

    }

}
